/*
 * @Author: TC 
 * @Date: 2021-09-26 14:42:06 
 * @Last Modified by: TC
 * @Last Modified time: 2021-11-24 14:50:00
 */

import { v3, Vec3 } from "cc";

//数据类
export class GameData {

    public static bClick: boolean = false;
    public static roleSpeed: number = 200;
    public static mstInfo: JSON = null;
    public static info2dPos: Vec3 = v3(0, 1.8, 0);
    public static distance: number = 18.5;
    public static minUIScale: number = 0.5;
    public static maxUIScale: number = 1.5;
    public static gameTime: number = 120;
    public static bombTime: number = 5;
    public static addTime: number = 20;
}

export class UserInfo {
    constructor() {

    }

    private _launchOptions: any = null;//微信登录信息

    public scene: number = 0;//场景值
    public nickName: string = "";//昵称
    public avatarUrl: string = "";//头像地址
    public sex: number = 0;//性别
    public country: string = "";//国家
    public province: string = "";//省份
    public city: string = "";//城市
    public account: string = "";//账户
    public linkId: string = "";//linkID
    public record: number = 0;//游戏记录
    public source: string = "";//source
    public channel: string = "";//channel
    public userId: string = "";//用户ID
    public shareId: string = "";//分享卡片id

    public updateUserInfo(info: any): void {
        this.nickName = info.nickname;
        this.avatarUrl = info.avatarUrl;
        this.province = info.province;
        this.city = info.city;
        this.account = info.account;
        this.linkId = info.linkId;
        this.record = info.record;
        this.source = info.source;
        this.userId = info.userId;
    }

    public set launchOptions(option: any) {
        this._launchOptions = option;
    }

    public get launchOptions(): any {
        return this._launchOptions;
    }

}
